new Vue({
  el: '#root',

  data: {
    email: '',
    name: '',
    content: '',
    phone: '',
    title: '',
    alert: {
      emailAlert: false,
      phoneAlert: false,
      nameAlert: false,
    },
  },

  methods: {
    onBlurInput (field) {
      this.alert[`${field}Alert`] = this[field].trim() === ''
    },
    submit () {
      ['email', 'name', 'phone'].forEach(item => {
        this.alert[`${item}Alert`] = this[item].trim() === ''
      })
    }
  },

})